﻿<%@ Page Title="Report - Multimedia" Language="C#" MasterPageFile="~/user.master"
    AutoEventWireup="true" Inherits="MediaMonitor.Users.Report_All" Theme="default"
    CodeBehind="report-all.aspx.cs" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">
    <link href="../rad-scripts/Grid.MyCustomSkin.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function doSaveAs() {
           
            var bSuccess;
            bSuccess = document.execCommand('SaveAs');
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="Server">
     <asp:UpdatePanel ID="pnlUpdate" runat="server">
        <ContentTemplate>
   <div id="InnerDIVTOP" runat="server" visible="false">
        <div style="text-align: right; padding-right: 10px; padding-bottom: 5px;">
            
              <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
            <td align="right">
             <asp:Panel runat="server" ID="PnlAdv"  Visible="false" >
            <span style="padding-left:10px;">Advertiser :</span>
            <asp:Button ID="btnDownloadAllAdv" runat="server" Text="Download All" 
                 OnClick="btnDownloadAllAdv_Clicked"/>
                </asp:Panel>
            </td>
            <td  align="right">
              <asp:Panel runat="server" ID="PnlProduct"  Visible="false">
             <span style="padding-left:10px;">Product:</span>
            <asp:Button ID="btnDownloadAllProduct" runat="server" Text="Download All"
              OnClick="btnDownloadAllProduct_Clicked" />
                 </asp:Panel>
            </td>

            <td align="right">
             <asp:Panel runat="server" ID="pnlCategory"  Visible="false" >
            <span style="padding-left:10px;">Category :</span>
           
           <asp:Button ID="btnDownloadAll" runat="server"    OnClick="btnDownloadAll_Clicked"
                     Text="Download All" />
               
                </asp:Panel>
                </td>

               
           <td align="right" style="width:15%;">
            <asp:Button ID="btnExport" runat="server" Text="Export" OnClick="btnExport_Clicked" />
            </td>
            </tr>
            </table>
        </div>
        <div style="text-align: center; padding: 10px; padding-bottom: 20px; border: none;">
            <asp:LinkButton ID="lnlBack" runat="server" Text="..Go back to summary.." OnClick="lnlBack_Clicked"
                Font-Size="16"></asp:LinkButton>
        </div>
    </div>
  
  <div id="SummaryDIVTOP" runat="server" visible="false">
        <div style="text-align: right; padding-right: 10px; padding-bottom: 5px;">
            
           <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td width="10%" align="left">
            <asp:Label ID="lblSummary" runat="server" Text="SUMMARY" ForeColor="#0066FF"   Font-Size="14"></asp:Label>
              </td>
       <td align="right" width="90%" >
            
            <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
            <td align="right">
             <asp:Panel runat="server" ID="pnlSummaryAdv"  Visible="false" >
            <span style="padding-left:10px;">Advertiser :</span>
            <asp:Button ID="btnDownloadAllSummaryAdvertiser" runat="server" Text="Download All" 
                 OnClick="btnDownloadAllSummaryAdvertiser_Clicked"/>
                </asp:Panel>
            </td>
            <td  align="right">
              <asp:Panel runat="server" ID="pnlSummaryProduct"  Visible="false">
             <span style="padding-left:10px;">Product:</span>
            <asp:Button ID="btnDownloadAllSummaryProduct" runat="server" Text="Download All" 
                OnClick="btnDownloadAllSummaryProduct_Clicked"/>
                 </asp:Panel>
            </td>
            <td  align="right">
               <asp:Panel runat="server" ID="pnlSummaryCategory" Visible="false">
          <span style="padding-left:10px;">Category:</span>
            <asp:Button ID="btnDownloadAllSummary" runat="server" Text="Download All" 
                OnClick="btnDownloadAllSummary_Clicked" />
               </asp:Panel>
            </td>
            <td  align="right" style="width:25%;">
             <asp:Button ID="btnExportSummary" runat="server" Text="Export with Summary" OnClick="btnExportSummary_Clicked"/> 
            </td>
            </tr>
            </table>
          </td>
            </tr></table>
        </div>
       
    </div>

       <telerik:RadGrid ID="radGridAll" runat="server" AutoGenerateColumns="false" AllowSorting="True"
                GridLines="Both" PageSize="20" ItemStyle-Font-Size="7" EnableEmbeddedSkins="false"
                Skin="MyCustomSkin" EnableEmbeddedBaseStylesheet="False" OnNeedDataSource="radGridAll_NeedDataSource"
                OnItemCommand="radGridAll_ItemCommand" MasterTableView-AllowPaging="false">
                <MasterTableView Name="ReportAll" ItemStyle-BorderWidth="1" DataKeyNames="MediaType,CountRecord">
                    <AlternatingItemStyle Font-Size="Small" />
                    <ItemStyle Font-Size="Small" />
                    <Columns>
                        <telerik:GridTemplateColumn ItemStyle-Width="20px" UniqueName="MediaType">
                            <ItemTemplate>
                                
                                <asp:Label ID="lblMTN" Text='<%#Eval("MediaType")%>' runat="server" Visible="false"></asp:Label>
                                <img src='../images/media/<%#Eval("MediaTypeName")%>.png' alt='<%#Eval("MediaTypeName")%>' />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn ItemStyle-Width="400" UniqueName="CountRecord"  HeaderText="Media Total Records">
                            <ItemTemplate>
                                found <b>
                                    <%#Eval("CountRecord")%></b> records related to your search
                            </ItemTemplate>
                            
                        </telerik:GridTemplateColumn>
                         <telerik:GridBoundColumn DataField="InvestmentGrid" HeaderText="Total Investment" DataFormatString="{0:C0}"
                                ItemStyle-HorizontalAlign="Right" UniqueName="Investment"   />


                        <telerik:GridTemplateColumn ItemStyle-Width="235" UniqueName="Video" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate >
                                <asp:LinkButton ID="lnkGetDetail" runat="server"  CommandName="GetDetail" Text="Click for Details">
                                </asp:LinkButton>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
            <asp:ObjectDataSource ID="objDSAll" runat="server" TypeName="MediaMonitor.Common.ReportFuncs"
                SelectMethod="GetReportAll_Count2" SelectCountMethod="GetReportAll_RowCountTotal2"
                EnablePaging="true" StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maximumRows"
                SortParameterName="sortColumn" OnSelecting="ObjDS_Selecting">
                <SelectParameters>
                    <asp:Parameter Name="userID" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="SDateint" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="EDateint" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                     <asp:Parameter Name="SDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="EDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="searchTV" Type="Boolean" DefaultValue="false" />
                    <asp:Parameter Name="searchRD" Type="Boolean" DefaultValue="false" />
                    <asp:Parameter Name="searchCB" Type="Boolean" DefaultValue="false" />
                    <asp:Parameter Name="searchPR" Type="Boolean" DefaultValue="false" />
                    <asp:Parameter Name="searchOD" Type="Boolean" DefaultValue="false" />
                    <asp:Parameter Name="mediaCodes" Type="String" DefaultValue="" />
                    <asp:Parameter Name="sectorName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="subSectorName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="categoryName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="advertiserName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="brandName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="productName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="agencyName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="sPrice" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="ePrice" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="fa" Type="Boolean" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="searchIN" Type="Boolean" DefaultValue="false" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <div id="InnerDIV" runat="server" style="display:none;"><%-- visible="false"--%>
                <div style="display: none;">
                    <div style="float: left; text-align: left; padding: 10px; border: none;">
                        <table>
                            <tr>
                                <td>
                                    <asp:LinkButton ID="lnkGrp_Adv" runat="server" Text="Group Advertiser" CommandArgument="AdvertiserName"
                                        OnClick="lnkGrp_Clicked" class="Box"></asp:LinkButton>
                                </td>
                                <td>
                                    <asp:LinkButton ID="lnkGrp_Agnc" runat="server" Text="Group Agency" CommandArgument="AgencyName"
                                        OnClick="lnkGrp_Clicked" class="Box"></asp:LinkButton>
                                </td>
                                <td>
                                    <asp:LinkButton ID="lnkGrp_Brnd" runat="server" Text="Group Product" CommandArgument="BrandName"
                                        OnClick="lnkGrp_Clicked" class="Box"></asp:LinkButton>
                                </td>
                                <td>
                                    <asp:LinkButton ID="lnkGrp_Media" runat="server" Text="Group Media" CommandArgument="MediaName"
                                        OnClick="lnkGrp_Clicked" class="Box"></asp:LinkButton>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div style="float: right; text-align: right; padding: 10px; border: none;">
                        <asp:LinkButton ID="lnkClearGroup" runat="server" Text="[Clear Grouping]" Visible="false"
                            OnClick="lnkClearGroup_Clicked"></asp:LinkButton>
                    </div>
                </div>
                <telerik:RadGrid ID="radGrid" runat="server" AllowPaging="True" AutoGenerateColumns="false"
                    AllowSorting="True" GridLines="Both" OnPreRender="radGrid_PreRender" PageSize="20"
                    ItemStyle-Font-Size="7" EnableEmbeddedSkins="false" Skin="MyCustomSkin" PagerStyle-FirstPageText="First"
                    PagerStyle-LastPageText="Last" PagerStyle-NextPageText="Next" PagerStyle-PrevPageText="Previous"
                    PagerStyle-VerticalAlign="Middle" OnItemCommand="radGrid_ItemCommand" EnableEmbeddedBaseStylesheet="False"
                    OnNeedDataSource="radGrid_NeedDataSource" ShowGroupPanel="True" ><%-- OnExcelExportCellFormatting="radGrid_ExcelExportCellFormatting"--%>
                     <%--<ExportSettings ExportOnlyData="true"  FileName="MediaMonitor-Report" > IgnorePaging="true" Excel-Format="ExcelML"
                       <Excel Format="HTML" FileExtension="xls" /> 
                    </ExportSettings> --%>
                    <MasterTableView Name="Report" ShowFooter="true" ItemStyle-BorderWidth="1" DataKeyNames="ProdVersionID,ProductCode,  Price, MediaTypeCode,RFDate, PressFile, OutDoorFile,ShortVideoFile,RadioFile,CableFile,StreetGraph">
                        <FooterStyle Font-Bold="true" ForeColor="AliceBlue" />
                        <GroupHeaderItemStyle Font-Bold="true" Font-Size="Larger" />
                        <AlternatingItemStyle Font-Size="Smaller" />
                        <ItemStyle Font-Size="Smaller" />
                        <Columns>
                            <telerik:GridBoundColumn DataField="RFDate" DataFormatString="{0:d}"
                                HeaderText="Date" UniqueName="RFDate" ItemStyle-Font-Size="7" HeaderStyle-Width="70px"
                                ItemStyle-Width="70px" /> <%-- HtmlEncode="false"--%>
                            <telerik:GridTemplateColumn HeaderStyle-Width="30px" ItemStyle-Width="30px" UniqueName="MediaType">
                                <ItemTemplate>
                                    <img src='../images/media/<%#Eval("MediaTypeName")%>.png' alt='<%#Eval("MediaTypeName")%>' />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="MediaName" HeaderText="Media" UniqueName="Media"
                                ItemStyle-Font-Size="7" />
                            <telerik:GridBoundColumn DataField="BrandName" HeaderText="Product" UniqueName="ProductName"
                                ItemStyle-Font-Size="7" />
                            <telerik:GridBoundColumn DataField="ProdVersionName" HeaderText="Version" UniqueName="ProdVersion"
                                ItemStyle-Font-Size="7" HeaderStyle-Width="100px" ItemStyle-Width="100px" />
                            <telerik:GridBoundColumn DataField="SectorName" HeaderText="Sector" UniqueName="Sector"
                                ItemStyle-Font-Size="7" />
                            <telerik:GridBoundColumn DataField="SubSectorName" HeaderText="Sub Sector" UniqueName="SubSector"
                                ItemStyle-Font-Size="7" HeaderStyle-Width="120px" ItemStyle-Width="120px" />
                            <telerik:GridBoundColumn DataField="CategoryName" HeaderText="Category" UniqueName="Category Name"
                                ItemStyle-Font-Size="7" HeaderStyle-Width="120px" ItemStyle-Width="120px" />
                            <telerik:GridBoundColumn DataField="RealCost" HeaderText="Investment" DataFormatString="{0:C0}"
                                ItemStyle-HorizontalAlign="Right" UniqueName="RealCost" ItemStyle-Font-Size="7" />
                            <telerik:GridBoundColumn DataField="AdvertiserName" HeaderText="Advertiser" UniqueName="Advertiser"
                                ItemStyle-Font-Size="7" HeaderStyle-Width="80px" ItemStyle-Width="80px" />
                            <%-- <telerik:GridBoundColumn DataField="AgencyName" HeaderText="Agency" UniqueName="Agency"
                            ItemStyle-Font-Size="7" />
                        
                        <telerik:GridBoundColumn DataField="BrandName" HeaderText="Product" UniqueName="Product"
                            ItemStyle-Font-Size="7" />
                        <telerik:GridBoundColumn DataField="TimeStartFormatted" HeaderText="Start Time" ItemStyle-HorizontalAlign="Right"
                            UniqueName="STime" ItemStyle-Font-Size="7" />
                        <telerik:GridBoundColumn DataField="TimeEndFormatted" HeaderText="End Time" ItemStyle-HorizontalAlign="Right"
                            UniqueName="ETime" ItemStyle-Font-Size="7" Visible="false" />--%>
                            <telerik:GridTemplateColumn HeaderText="Preview" HeaderStyle-Width="50px" ItemStyle-Width="50"
                                UniqueName="Video">
                                <ItemTemplate>
                                    <!--for TV-->
                                    <a href="javascript:void(0);" onclick="PopupCenter('../sitefiles/video.aspx?pvid=<%#Eval("ProdVersionID")%>&t=s', '_blank', 350, 280); ">
                                        <span style='color: <%# Utility.ToBool(Eval("ShortVideo"))==true ? "green" : "red"%>;'>
                                            <%#Utility.GetFormattedBool(Utility.ToInt(Eval("MediaTypeCode"))==1 && Utility.CheckVideoAvailability(Utility.ToStr(Eval("ShortVideoFile")).ToString()), "Preview", "")%>
                                        </span></a>
                                    <!--for RADIO-->
                                    <a href="javascript:void(0);" onclick="PopupCenter('../sitefiles/radio.aspx?pvid=<%#Eval("ProdVersionID")%>&t=s', '_blank', 350, 280); ">
                                        <span style='color: <%# Utility.ToStr(Eval("RadioFile"))!="" ? "green" : "red"%>;'>
                                            <%#Utility.GetFormattedBool(Utility.ToInt(Eval("MediaTypeCode"))==3 &&  Utility.CheckRadioAvailability(Utility.ToStr(Eval("RadioFile")).ToString()), "Preview", "")%>
                                        </span></a>
                                    <!--for CABLE-->
                                    <a href="javascript:void(0);" onclick="PopupCenter('../sitefiles/cable.aspx?pvid=<%#Eval("ProdVersionID")%>&t=s', '_blank', 350, 280); ">
                                        <span style='color: <%# Utility.ToStr(Eval("CableFile"))=="" ? "green" : "red"%>;'>
                                            <%#Utility.GetFormattedBool(Utility.ToInt(Eval("MediaTypeCode")) == 5 &&  Utility.CheckCableAvailability(Utility.ToStr(Eval("CableFile")).ToString()), "Preview", "")%>
                                        </span></a>
                                    <!--for PRESS-->
                                    <a href="javascript:void(0);" onclick="PopupCenterWithScroll('../sitefiles/press.aspx?pvid=<%#Eval("ProdVersionID")%>&t=s&file=<%#Eval("PressFile")%>', '_blank',750, 700); ">
                                        <span style='color: <%# Utility.ToStr(Eval("PressFile"))!="" ? "green" : "red"%>;'>
                                            <%#Utility.GetFormattedBool(Utility.ToInt(Eval("MediaTypeCode")) == 6 &&  Utility.CheckPressAvailability(Utility.ToStr(Eval("PressFile")).ToString()), "Preview", "")%>
                                        </span></a>
                                    <!--for OutDoor-->
                                    <a href="javascript:void(0);" onclick="PopupCenterWithScroll('../sitefiles/outdoor.aspx?pvid=<%#Eval("ProdVersionID")%>&t=s', '_blank', 750, 700); ">
                                        <span style='color: <%# Utility.ToStr(Eval("OutDoorFile"))!="" ? "green" : "red"%>;'>
                                            <%#Utility.GetFormattedBool(Utility.ToInt(Eval("MediaTypeCode")) == 7 &&  Utility.CheckOutDoorAvailability(Utility.ToStr(Eval("OutDoorFile")).ToString()), "Preview", "")%>
                                        </span></a>
                                    <br />
                                    <!--for OUTDOOR Street Graph-->
                                    <a href="javascript:void(0);" onclick="PopupCenterWithScroll('../sitefiles/outdoor-street.aspx?file=<%#Eval("StreetGraph")%>', '_blank',810, 500); ">
                                        <span style='color: green'>
                                            <%#Utility.GetFormattedBool(Utility.ToInt(Eval("MediaTypeCode")) == 7, "Street Graph", "")%>
                                        </span></a>
                                    <!--for INTERNET-->
                                    <a href="javascript:void(0);" onclick="PopupCenterWithScroll('../sitefiles/internet.aspx?date=<%#Eval("RFDate").ToString().Replace("/", "_")%>&pvid=<%#Eval("ProdVersionID")%>&t=s&file=<%#Eval("PressFile")%>', '_blank',750, 700); ">
                                        <span style='color: <%# Utility.ToStr(Eval("PressFile"))!="" ? "green" : "red"%>;'>
                                            <%#Utility.GetFormattedBool(Utility.ToInt(Eval("MediaTypeCode")) == 9 && Utility.CheckInternetAvailability(Utility.ToStr(Eval("PressFile")).ToString(),Utility.ToStr(Eval("RFDate")).ToString()), "Preview", "")%>
                                        </span></a>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Price" ItemStyle-HorizontalAlign="Center"
                                UniqueName="Cart" ItemStyle-Font-Size="7">
                                <ItemTemplate>
                                    <small>
                                        <%# Utility.GetCurrency(DataBinder.Eval(Container.DataItem, "Price", "<b>{0:C2}</b>"))%><br />
                                        <asp:LinkButton ID="lnkAdd2Cart" runat="server" CommandName="Add2Cart" CommandArgument='<%#Eval("ProdVersionCode")%>'>
                                       
                                     <%--   OnClientClick="return confirm('Are you sure to add this Product to Shopping Cart?')"--%>
                                <img src="../app_themes/default/buttons/cart-icon.png" alt="" />    
                                        </asp:LinkButton>
                                        <!-- add this attribute to above lnkAdd2Cart if u dont wanna show cart icon for unavailable videos
                                  Visible='%#Utility.CheckVideoAvailability(Eval("FullVideoFile").ToString())%>'> 

                                -->
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true">
                    </ClientSettings>
                    <ClientSettings AllowDragToGroup="True" AllowColumnsReorder="true" ReorderColumnsOnClient="true">
                        <Resizing AllowColumnResize="true" />
                    </ClientSettings>
                </telerik:RadGrid>
            </div>
            <asp:ObjectDataSource ID="objDS" runat="server" TypeName="MediaMonitor.Common.ReportFuncs"
                SelectMethod="GetReportAll_Paged2" SelectCountMethod="GetReportAll_RowCount2" EnablePaging="true"
                StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maximumRows"
                SortParameterName="sortColumn" OnSelecting="ObjDS_Selecting">
                <SelectParameters>
                    <asp:Parameter Name="userID" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="SDateint" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="EDateint" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="sDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="eDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="searchTV" Type="Boolean" DefaultValue="false" />
                    <asp:Parameter Name="searchRD" Type="Boolean" DefaultValue="false" />
                    <asp:Parameter Name="searchCB" Type="Boolean" DefaultValue="false" />
                    <asp:Parameter Name="searchPR" Type="Boolean" DefaultValue="false" />
                    <asp:Parameter Name="searchOD" Type="Boolean" DefaultValue="false" />
                    <asp:Parameter Name="mediaCodes" Type="String" DefaultValue="" />
                    <asp:Parameter Name="sectorName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="subSectorName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="categoryName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="advertiserName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="brandName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="productName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="agencyName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="sPrice" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="ePrice" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="fa" Type="Boolean" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="MediaTypeCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="searchIN" Type="Boolean" DefaultValue="false" />
                </SelectParameters>
            </asp:ObjectDataSource>


             <asp:ObjectDataSource ID="objDSExport" runat="server" TypeName="MediaMonitor.Common.ReportFuncs"
                SelectMethod="GetReportAll_PagedExport2" SelectCountMethod="GetReportAll_RowCountExport2" EnablePaging="true"
                StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maximumRows"
                SortParameterName="sortColumn" OnSelecting="ObjDS_SelectingExport">
                <SelectParameters>
                    <asp:Parameter Name="userID" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="SDateint" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="EDateint" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="sDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="eDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="searchTV" Type="Boolean" DefaultValue="false" />
                    <asp:Parameter Name="searchRD" Type="Boolean" DefaultValue="false" />
                    <asp:Parameter Name="searchCB" Type="Boolean" DefaultValue="false" />
                    <asp:Parameter Name="searchPR" Type="Boolean" DefaultValue="false" />
                    <asp:Parameter Name="searchOD" Type="Boolean" DefaultValue="false" />
                    <asp:Parameter Name="mediaCodes" Type="String" DefaultValue="" />
                    <asp:Parameter Name="sectorName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="subSectorName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="categoryName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="advertiserName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="brandName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="productName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="agencyName" Type="String" DefaultValue="" />
                    <asp:Parameter Name="sPrice" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="ePrice" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="fa" Type="Boolean" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="MediaTypeCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="searchIN" Type="Boolean" DefaultValue="false" />
                </SelectParameters>
            </asp:ObjectDataSource>


            

            <!--do not remove the following btn, used to open the popup-->
            <asp:LinkButton ID="btnShowPop" runat="server" Width="1" Height="1" />
            <!--start modal-->
            <script type="text/javascript">


                function SetPostion2(obj, width, height) {

                    if (!obj)
                        return;

                    var left = parseInt((screen.availWidth / 2) - (width / 2));
                    var top = parseInt((screen.availHeight / 2) - (height));

                    var scrollTop = document.body.scrollTop;
                    if (scrollTop == 0) {
                        if (window.pageYOffset)
                            scrollTop = window.pageYOffset;
                        else
                            scrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
                    }

                    obj.style.left = left + 'px';
                    obj.style.top = scrollTop + top + 'px';
                    //obj.style.width=width+'px';
                    //obj.style.height=height+'px';
                    obj.style.position = 'absolute';

                }

                function SetPositionBg2(obj) {
                    if (!obj)
                        return;

                    var left = 0;
                    var top = 0;

                    var scrollTop = document.body.scrollTop;
                    if (scrollTop == 0) {
                        if (window.pageYOffset)
                            scrollTop = window.pageYOffset;
                        else
                            scrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
                    }

                    obj.style.left = left + 'px';
                    obj.style.top = scrollTop + top + 'px';
                    //obj.style.width=width+'px';
                    obj.style.height = scrollTop + screen.availHeight + 'px';
                    obj.style.position = 'absolute';

                }

                function AjaxLoading2(tbl, dv, bool) {
                    if (bool) {
                        SetPostion2(document.getElementById(tbl), 350, 200);
                        SetPositionBg2(document.getElementById(dv));
                        document.getElementById(tbl).style.display = 'block';
                        //document.getElementById('dvBg').style.display='block';
                    }
                    else {
                        document.getElementById(tbl).style.display = 'none';
                        //document.getElementById('dvBg').style.display='none';
                    }
                }

            </script>
            <!--warning-->
            <asp:Panel ID="pnl" runat="server" Visible="false">
                <asp:HiddenField ID="hdnPV" runat="server" Value="0" />
                  <asp:HiddenField ID="hdnRFDate" runat="server" Value="0" />
                <asp:HiddenField ID="hdnPD" runat="server" Value="0" />
                <asp:HiddenField ID="hdnPrice" runat="server" Value="0" />
                <asp:HiddenField ID="hdnMTCode" runat="server" Value="0" />
                <asp:HiddenField ID="hdnPressFile" runat="server" Value="" />
                <asp:HiddenField ID="hdnOutDoorFile" runat="server" Value="" />
                <div id="dvBg2" style="display: block; width: 100%; height: 250%; text-align: center;
                    position: absolute; left: 0px; top: 0px;" class="GreyedOutCss">
                </div>
                <center>
                    <div id="dvWarning" style="border: solid 4px #ababab; padding: 20px; width: 350px;
                        height: 200px; background-color: White; z-index: 100; position: absolute; top: 400px;
                        left: 500px;">
                        <br />
                        <br />
                        <asp:Literal ID="ltrWarningOrderNum" runat="server" />
                        <br />
                        <br />
                        <asp:Button ID="btnCancel" runat="server" Text="Don't Purchase" OnClick="btnCancelPurchase_Clicked" />
                        <asp:Button ID="btnContinue" runat="server" Text="Continue with Purchase" OnClick="btnContinuePurchase_Clicked" />
                    </div>
                </center>
            </asp:Panel>
            <!--end warning-->
            <%-- </div>--%>
            <!--end modal-->
        </ContentTemplate>
         <Triggers>
      
         <asp:PostBackTrigger ControlID="btnExport" />
         <asp:PostBackTrigger ControlID="btnDownloadAll" />

          <asp:PostBackTrigger ControlID="btnDownloadAllAdv" />
           <asp:PostBackTrigger ControlID="btnDownloadAllProduct" />
          
           <asp:PostBackTrigger ControlID="btnExportSummary" />
         <asp:PostBackTrigger ControlID="btnDownloadAllSummary" />
         
          <asp:PostBackTrigger ControlID="btnDownloadAllSummaryProduct" />
            <asp:PostBackTrigger ControlID="btnDownloadAllSummaryAdvertiser" />
         </Triggers>

    </asp:UpdatePanel>
    
</asp:Content>
